home *** CD-ROM | disk | FTP | other *** search
/ HAKERIS 11 / HAKERIS 11.ISO / soft / development / Macromedia RoboHelp X5 / RoboHelpOffice.exe / Data1.cab / _E5B93D89684B4972A5FF8ED5A4B92170 < prev    next >
Encoding:
Text File  |  2002-10-07  |  8.4 KB  |  355 lines

  1. <html>
  2. <head>
  3. <title>Navigation Pane</title>
  4. <!--% WH_PROJECT_METATAGS %-->
  5. <script language="javascript" src="<!--%SF_VERSION_JS%-->"></script>
  6. <script language="javascript1.2" src="<!--%SF_MESSAGE_JS%-->"></script>
  7. <script language="javascript1.2" src="<!--%SF_PROXY_JS%-->"></script>
  8. <script language="javascript1.2" src="<!--%SF_UTILS_JS%-->"></script>
  9. <script language="javascript1.2">
  10. <!--
  11. var gsInitPane="toc";
  12. var gsCurrentPane="";
  13. var gbLoading = "unknown";
  14. var gbTryTime = 0;
  15. var gbMaxTryTime = 6;
  16. var gbPassPhase0 = 0;
  17. var gbretried = 0;
  18. var gbmaxretry = 3;
  19. var gbretrytime = new Array();
  20.  
  21. var origWidth = 0;
  22. var origHeight = 0;
  23.  
  24. gbretrytime[0]= 5000;
  25. gbretrytime[1]= 30000;
  26. gbretrytime[2]= 60000;
  27.  
  28. function addPane(sName, sFile)
  29. {
  30. }
  31.  
  32. function setShowPane(sName)
  33. {
  34.     gsInitPane=sName;
  35. }
  36. <!--%   OutputNavPaneConfigBlock.htm("  addPane(\"%s\",\"%s\");\r\n|  setShowPane(\"%s\");\r\n"); %-->
  37.  
  38. function window_unload()
  39. {
  40.     if (!gbNav4 || gbNav6) // resize will call unload, but the register code will never be called on Netscape 4.
  41.     {
  42.         UnRegisterListener2(this, WH_MSG_SHOWTOC);
  43.         UnRegisterListener2(this, WH_MSG_SHOWIDX);
  44.         UnRegisterListener2(this, WH_MSG_SHOWFTS);
  45.         UnRegisterListener2(this, WH_MSG_SHOWGLO);
  46.         UnRegisterListener2(this, WH_MSG_SYNCTOC);
  47.         UnRegisterListener2(this, WH_MSG_SEARCHTHIS);
  48.         UnRegisterListener2(this, WH_MSG_GETPANEINFO);
  49.     }
  50. }
  51.  
  52. function window_OnLoad()
  53. {
  54.     var bHidePane=false;
  55.     var oMsg=new whMessage(WH_MSG_GETCMD,this,1,null);
  56.     if (SendMessage(oMsg))
  57.     {
  58.         if(oMsg.oParam>0)
  59.         {
  60.             if(oMsg.oParam==1)
  61.                 gsInitPane="toc";
  62.             else if(oMsg.oParam==2)
  63.                 gsInitPane="idx";
  64.             else if(oMsg.oParam==3)
  65.                 gsInitPane="fts";
  66.             else if(oMsg.oParam==4)
  67.                 gsInitPane="glo";
  68.         }
  69.         else if(oMsg.oParam==0)
  70.         {
  71.             bHidePane=true;
  72.         }
  73.     }
  74.     if (bHidePane)
  75.     {
  76.         oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null)
  77.         SendMessage(oMsg);
  78.     }
  79.     else if (gsInitPane == "toc")
  80.     {
  81.         oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null)
  82.         SendMessage(oMsg);    
  83.     }
  84.     else if (gsInitPane=="idx")
  85.     {
  86.         oMsg=new whMessage(WH_MSG_SHOWIDX,this,1,null)
  87.         SendMessage(oMsg);    
  88.     }
  89.     else if (gsInitPane=="fts")
  90.     {
  91.         oMsg=new whMessage(WH_MSG_SHOWFTS,this,1,null)
  92.         SendMessage(oMsg);    
  93.     }
  94.     else if (gsInitPane=="glo")
  95.     {
  96.         oMsg=new whMessage(WH_MSG_SHOWGLO,this,1,null)
  97.         SendMessage(oMsg);    
  98.     }
  99.     
  100. }
  101.  
  102. function onResize()
  103. {
  104.     var oMsg=null;
  105.     if (gbIE4)
  106.     {
  107.         if(document.body)
  108.         {
  109.             if(document.body.clientWidth > 1 && document.body.clientHeight>1)
  110.             {
  111.                 oMsg = new whMessage(WH_MSG_RESIZEPANE,this,1,null);
  112.                 SendMessage(oMsg);
  113.             }
  114.         }
  115.     }
  116.     else 
  117.     {
  118.         if (window.innerWidth != 0 && window.innerHeight != 0)
  119.         {
  120.             oMsg = new whMessage(WH_MSG_RESIZEPANE,this,1,null);
  121.             SendMessage(oMsg);
  122.         }
  123.     }
  124. }
  125.  
  126. function CheckLoadingPhase0()
  127. {
  128.     if (!gbPassPhase0) {
  129.         setTimeout("CheckLoadingPhase0()", 1000);
  130.         document.applets[0];
  131.         gbPassPhase0 = 1;
  132.     }
  133.     else {
  134.         CheckLoadingPhase1();
  135.     }
  136. }
  137.  
  138. function CheckLoadingPhase1()
  139. {
  140.     if (gbNav4) {
  141.         if ("unknown" == gbLoading && document.readystate < 4) {
  142.             setTimeout("CheckLoadingPhase1()", 1000);
  143.         }
  144.         else if ("unknown" == gbLoading) {
  145.             CheckLoadingPhase2();
  146.         }
  147.     }
  148. }
  149.  
  150. function CheckLoadingPhase2()
  151. {
  152.     if (gbNav4) {
  153.         gbTryTime ++;
  154.         if ("unknown" == gbLoading) {
  155.             if (gbTryTime <= gbMaxTryTime )
  156.                 setTimeout("CheckLoadingPhase2()", 1000);
  157.             else {
  158.                 if (gnVerMinor != 4.60) {
  159.                     alert("%%% WH_CUR_LNG.JS_alert_appletNotLoad %%%");
  160.                 }
  161.             }    
  162.         }
  163.     }
  164. }
  165.  
  166. function CheckAppletLoaded()
  167. {
  168.     if (typeof(document.WebHelp) == "undefined")
  169.     {
  170.         document.location.reload();
  171.         if (gbretried < gbmaxretry)
  172.         {
  173.             gbretried ++;
  174.             setTimeout("CheckAppletLoaded();", gbretrytime[gbretried]);
  175.         }
  176.     }
  177. }
  178.  
  179. function reDo() 
  180. {
  181.     if (innerWidth != origWidth || innerHeight != origHeight)  
  182.     {
  183.         //reloaded applet if nessary
  184.         gbretried = 0;
  185.  
  186.         if (gnVerMinor == 4.60) 
  187.         {
  188.             //reload the applet again.
  189.             document.location.reload();
  190.             gbretried ++;
  191.         }
  192.         setTimeout("CheckAppletLoaded();", gbretrytime[gbretried]);
  193.     }
  194. }
  195.  
  196. function onSendMessage(oMsg)
  197. {
  198.     if (oMsg)
  199.     {    
  200.         var nMsgId = oMsg.nMessageId;
  201.         var WebHelpApplet = null;
  202.         if (gbNav4)
  203.         {
  204.             WebHelpApplet = document.applets["WebHelp"];
  205.             if (!WebHelpApplet.Command)
  206.                 document.location="%%% WEBHELP_TEMPLATE.pane.navpane.list %%%";
  207.         }
  208.         else
  209.             WebHelpApplet = window.WebHelp;
  210.  
  211.         if(nMsgId==WH_MSG_GETPANEINFO)
  212.         {
  213.             oMsg.oParam=gsCurrentPane;
  214.             return false;
  215.         }
  216.         else if(gbLoading!="unknown" || gbNav6)
  217.         {
  218.             if (nMsgId == WH_MSG_SHOWTOC)
  219.             {
  220.                 gsCurrentPane="toc";
  221.                 WebHelpApplet.Command("Contents",null);
  222.                 var onMsg=new whMessage(WH_MSG_PANEINFO,this,1,"toc");
  223.                 SendMessage(onMsg);
  224.                 onMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
  225.                 SendMessage(onMsg);
  226.             }
  227.             else if(nMsgId==WH_MSG_SHOWIDX)
  228.             {
  229.                 gsCurrentPane="idx";
  230.                 WebHelpApplet.Command("Index",null);
  231.                 var onMsg=new whMessage(WH_MSG_PANEINFO,this,1,"idx");
  232.                 SendMessage(onMsg);
  233.                 onMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
  234.                 SendMessage(onMsg);
  235.             }
  236.             else if(nMsgId==WH_MSG_SHOWFTS)
  237.             {
  238.                 gsCurrentPane="fts";
  239.                 WebHelpApplet.Command("Search",null);
  240.                 var onMsg=new whMessage(WH_MSG_PANEINFO,this,1,"fts");
  241.                 SendMessage(onMsg);
  242.                 onMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
  243.                 SendMessage(onMsg);
  244.             }
  245.             else if(nMsgId==WH_MSG_SHOWGLO)
  246.             {
  247.                 gsCurrentPane="glo";
  248.                 WebHelpApplet.Command("Glossary",null);
  249.                 var onMsg=new whMessage(WH_MSG_PANEINFO,this,1,"glo");
  250.                 SendMessage(onMsg);
  251.                 onMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
  252.                 SendMessage(onMsg);
  253.             }
  254.             else if(nMsgId==WH_MSG_SYNCTOC)
  255.             {
  256.                 gsCurrentPane="toc";
  257.                 var oTopicParam=oMsg.oParam;
  258.                 if(oTopicParam&&oTopicParam.aPaths&&oTopicParam.aPaths.length>0&&oTopicParam.sPPath)
  259.                 {
  260.                     var sPPath=_browserStringToText(oTopicParam.sPPath);
  261.                     var sParam="";
  262.                     for(var i=0;i<oTopicParam.aPaths.length;i++)
  263.                     {
  264.                         sParam+=oTopicParam.aPaths[i]+"\r\r";
  265.                     }
  266.                     WebHelpApplet.Command("SyncToc",sPPath,sParam);
  267.                 }
  268.             }
  269.             else if(nMsgId==WH_MSG_SEARCHTHIS)
  270.             {
  271.                 gsCurrentPane="fts";
  272.                 WebHelpApplet.Command("Search",oMsg.oParam);
  273.                 var onMsg=new whMessage(WH_MSG_PANEINFO,this,1,"fts");
  274.                 SendMessage(onMsg);
  275.                 onMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null);
  276.                 SendMessage(onMsg);
  277.             }
  278.         }
  279.     }
  280.     return true;
  281. }
  282.  
  283. function getInitTocInfo()
  284. {
  285.     var oParam=new Object();
  286.     oParam.oTocInfo=null;
  287.     var oMsg=new whMessage(WH_MSG_GETTOCPATHS,this,1,oParam);
  288.     if(SendMessage(oMsg))
  289.     {
  290.         var oTopicParam=oMsg.oParam.oTocInfo;
  291.         if(oTopicParam&&oTopicParam.aPaths&&oTopicParam.aPaths.length>0&&oTopicParam.sPPath)
  292.         {
  293.             var sPPath=_browserStringToText(oTopicParam.sPPath);
  294.             var sParam="";
  295.             for(var i=0;i<oTopicParam.aPaths.length;i++)
  296.             {
  297.                 sParam+=oTopicParam.aPaths[i]+"\r\r";
  298.             }
  299.             var WebHelpApplet;
  300.             if(gbNav4)
  301.                 WebHelpApplet=document.applets["WebHelp"];
  302.             else
  303.                 WebHelpApplet=WebHelp;
  304.             WebHelpApplet.Command("SyncToc",sPPath,sParam);
  305.         }
  306.     }
  307. }
  308.  
  309. if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy)
  310. {
  311.     RegisterListener2(this, WH_MSG_SHOWTOC);
  312.     RegisterListener2(this, WH_MSG_SHOWIDX);
  313.     RegisterListener2(this, WH_MSG_SHOWFTS);
  314.     RegisterListener2(this, WH_MSG_SHOWGLO);
  315.     RegisterListener2(this, WH_MSG_SYNCTOC);
  316.     RegisterListener2(this, WH_MSG_SEARCHTHIS);
  317.     RegisterListener2(this, WH_MSG_GETPANEINFO);
  318.  
  319.     window.onresize=onResize;
  320.     window.onunload = window_unload;
  321.     window.onload=window_OnLoad;
  322.     window.onerror = null;
  323.     var gbWindows = ((gAgent.indexOf("win") != -1) || (gAgent.indexOf("16bit") != -1));
  324.  
  325.     if (gbNav4 && !gbNav6 && gbWindows) {
  326.         setTimeout("CheckLoadingPhase0()", 1000);
  327.     }
  328.     if (gbNav4)
  329.     {
  330.         origWidth = innerWidth;
  331.         origHeight = innerHeight;
  332.         onresize = reDo;
  333.     }
  334. }
  335. else
  336.     document.location.reload();
  337.  
  338. if (window.gbNav6)
  339. {
  340.     var oMsg=new whMessage(WH_MSG_RELOADNS6,this, 1,null);
  341.     SendMessage(oMsg);
  342. }
  343. //-->
  344. </script>
  345. </head>
  346. <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" bgcolor="c0c0c0">
  347. <applet code=WebHelp.class name=WebHelp  archive=%%%SF_APPLET_CODE_JAR%%% width=100% height=100% MAYSCRIPT hspace=0 vspace=0>
  348. <PARAM name=ProjectFile value=%%%SF_PROJECT_XML%%%><PARAM name=ResourceFile value=%%%SF_APPLET_RES_XML%%%>
  349. <PARAM name=HideTabs value=true>
  350. <PARAM name=Frame value=bsscright>
  351. <PARAM name=cabbase value=%%%SF_APPLET_CODE_CAB%%%>
  352. </applet>
  353. </body>
  354. </html>
  355.